package com.chexiehui.jc.mvp.car;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.DictInfo;
import com.chexiehui.jc.entity.SpecialCarInfo;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 特价车
 * @Auth SongJun
 * @Date 2019/11/20 10:05
 **/
public interface SpecialCarListCovenant {

    interface View extends BaseView {
        void onGetListSuccess(BaseModel<BasePage<SpecialCarInfo>> successResult);

        void onGetListFailure(BaseModel<Object> failureResult);

        void onGetBigTypeSuccess(BaseModel<List<DictInfo>> successResult);

        void onGetBigTypeFailure(BaseModel<Object> failureResult);

        String getSeriesId();
        String getPriceMax();
        String getPriceMin();
        String getSortType();
        String getBigTypeId();
    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_CAR_GRADE_LIST)
        Observable<BaseModel<List<DictInfo>>> getCarType(@Field("type") String type, @Field("id") String id);

        @FormUrlEncoded
        @POST(Constants.URL_CAR_SPECIAL_LIST)
        Observable<BaseModel<BasePage<SpecialCarInfo>>> getList(
                @Field("seriesid") String seriesid,
                @Field("descType") String descType,
                @Field("seriesType") String seriesType,
                @Field("priceMin") String priceMin,
                @Field("priceMax") String priceMax,
                @Field("pageIndex") int pageIndex,
                @Field("pageSize") int pageSize
        );
    }

    interface Presenter {
        void getList(int pageNum);
        void getBigType();
    }

}